package com.rogue.generator.service.impl;

import com.rogue.generator.service.GeneratorService;
import com.rogue.generator.util.IdGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class GeneratorServiceImpl implements GeneratorService {

    private final static Logger logger = LoggerFactory.getLogger(GeneratorServiceImpl.class);

    @Override
    public long nextId() throws Exception {
        long id = new IdGenerator(1).nextId();
        logger.info("Generator id: " + id);
        return id;
    }
}
